package com.atguigu.gulimall.ware.feign;

import com.atguigu.common.utils.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

@Component
@FeignClient("gulimall-product")
public interface ProductFeignService {
    /**
     * 这里的feign接口层有两种写法：
     *
     * 1.让所有请求经过网关：
     *      1.@FeignClient("gulimall-gateway")
     *      2.@RequestMapping("/api/product/skuinfo/info/{skuId}")
     *
     * 2.直接让后台指定服务器处理
     *      1.@FeignClient("gulimall-product")
     *      2.@RequestMapping("/product/skuinfo/info/{skuId}")
     * @param skuId
     * @return
     */
    @RequestMapping("/product/skuinfo/info/{skuId}")
    public R info(@PathVariable("skuId") Long skuId);
}
